import { useCache } from '@/hooks/web/useCache'

const LANGUAGE_KEY = 'lang'

export function getLang() {
  const { wsCache } = useCache('localStorage')

  return wsCache.get(LANGUAGE_KEY)
}

export function setLang(lang: string) {
  const { wsCache } = useCache('localStorage')
  // 设置token
  wsCache.set(LANGUAGE_KEY, lang)
}

export function cleanToken() {
  const { wsCache } = useCache('localStorage')
  // 设置token
  wsCache.delete(LANGUAGE_KEY)
}